﻿namespace OpenComposite.Inbox.Forms
{
	using System;
	using System.Collections.Generic;
	using System.ComponentModel;
	using System.Data;
	using System.Drawing;
	using System.Text;
	using System.Windows.Forms;

	public partial class FormAdHocActivity : Form
	{
		#region Initialization

		public FormAdHocActivity(string firstTitle, string secondTitle, string from, string message)
		{
			InitializeComponent();

			lblProcName.Text = firstTitle;
			lblActName.Text = secondTitle;
			lblSender.Text = from;
			txtSenderMessage.Text = message;

			this.DialogResult = DialogResult.Cancel;
		}

		#endregion Initialization

		#region Public Members

		#region Properties

		public bool IsCompleted
		{
			get;
			set;
		}

		public string NewMessageText
		{
			get { return this.txtNewMessage.Text; }
			set { this.txtNewMessage.Text = value; }
		}

		#endregion Properties

		#endregion Public Members

		#region Private Members

		#region Event Handlers

		private void frmAdHocActivity_Load(object sender, EventArgs e)
		{
			if ( IsCompleted ) {
				this.txtNewMessage.ReadOnly = true;
			}
		}

		private void tsbtnCancel_Click(object sender, EventArgs e)
		{
			this.DialogResult = DialogResult.Cancel;
			this.Close();
		}

		private void tsbtnComplete_Click(object sender, EventArgs e)
		{
			this.DialogResult = DialogResult.OK;
			this.Close();
		}

		#endregion Event Handlers

		#endregion Private Members
	}
}